home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / nos042_s / rbsb.h < prev    next >
C/C++ Source or Header  |  1994-09-16  |  3KB  |  83 lines

  1. /****************************************************************************
  2. *    Language     :    Turbo C 2.0                                
  3. *    Logfile        :    rbsb.h    
  4. *    Project        :    Comms library.
  5. *    Date         :    25 Jan 90        
  6. *    Revision     :    1.1        GT    Originate.
  7. *    25 Oct 92    :    1.2        GT    KA9Q mods.
  8. *    24 Jan 94    :    1.3        GT    _flush -> _rbsb_flush.
  9. *****************************************************************************
  10. *    Purpose        :    Prototypes and externs for rbsb.c.
  11. *    $Id: rbsb.h 1.2 94/01/26 13:55:09 ROOT_DOS Exp $
  12.  ****************************************************************************/
  13.  
  14. #ifndef    RBSB_H
  15. #define    RBSB_H
  16.  
  17. /****************************************************************************
  18. *    sndbrk                                                                    *
  19. *    Send break to the modem.                                                *
  20. ****************************************************************************/
  21.  
  22. void _sendbrk (void);
  23.  
  24. /****************************************************************************
  25. *    _rdchk                                                                    *
  26. *    Returns nz if something to read from remote.                            *
  27. ****************************************************************************/
  28.  
  29. int _rdchk (void);
  30.  
  31. /****************************************************************************
  32. *    _send                                                                    *
  33. *    Send some data to the remote.                                            *
  34. ****************************************************************************/
  35.  
  36. int _send (unsigned char *buf, int len);
  37.  
  38.  
  39. /****************************************************************************
  40. *    _rbsb_flush        
  41. *    Flush output.    
  42. ****************************************************************************/
  43.  
  44. void _rbsb_flush (void);
  45.  
  46. /****************************************************************************
  47. *    _receive                                                                *
  48. *    Receive some data from the remote.                                        *
  49. ****************************************************************************/
  50.  
  51. int _receive (unsigned char *buf, int len);
  52.  
  53. extern unsigned short _crctab[];
  54. extern unsigned long _cr3tab[];
  55. extern int _z_socket;
  56.  
  57. /*
  58.  * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. 
  59.  *  NOTE: First srgument must be in range 0 to 255.
  60.  *        Second argument is referenced twice.
  61.  * 
  62.  * Programmers may incorporate any or all code into their programs, 
  63.  * giving proper credit within the source. Publication of the 
  64.  * source routines is permitted so long as proper credit is given 
  65.  * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, 
  66.  * Omen Technology.
  67.  */
  68.  
  69. #if    0
  70. #define updcrc(cp, crc) (_crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
  71. #endif
  72.  
  73. #define updcrc(cp, crc) (_crctab[(((crc) >> 8) & 255)] ^ ((crc) << 8) ^ (cp))
  74.  
  75. #if 0
  76. #define UPDC32(b, c) (_cr3tab[((int) c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFFL))
  77. #endif
  78.  
  79. #define UPDC32(b, c) (_cr3tab[((unsigned) (c) ^ (b)) & 0xff] ^ (((c) >> 8) & 0x00FFFFFFL))
  80.  
  81. #endif
  82.  
  83.